<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>base</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        Module&nbsp;base
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="base-pysrc.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<h1 class="epydoc">Source Code for <a href="base-module.html">Module base</a></h1>
<pre class="py-src">
<a name="L1"></a><tt class="py-lineno">  1</tt>  <tt class="py-line"><tt class="py-comment">#!/usr/bin/python</tt> </tt>
<a name="L2"></a><tt class="py-lineno">  2</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#coding: utf-8</tt> </tt>
<a name="L3"></a><tt class="py-lineno">  3</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
<a name="L4"></a><tt class="py-lineno">  4</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
<a name="L5"></a><tt class="py-lineno">  5</tt>  <tt class="py-line"><tt class="py-docstring">This module contains base definitions needed by different modules.</tt> </tt>
<a name="L6"></a><tt class="py-lineno">  6</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
<a name="L7"></a><tt class="py-lineno">  7</tt>  <tt class="py-line"> </tt>
<a name="L8"></a><tt class="py-lineno">  8</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">pygame</tt> </tt>
<a name="L9"></a><tt class="py-lineno">  9</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">math</tt> <tt class="py-keyword">import</tt> <tt class="py-name">fabs</tt> </tt>
<a name="L10"></a><tt class="py-lineno"> 10</tt>  <tt class="py-line"> </tt>
<a name="L11"></a><tt class="py-lineno"> 11</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-0" class="py-name" targets="Module dbmanager=dbmanager-module.html"><a title="dbmanager" class="py-name" href="#" onclick="return doclink('link-0', 'dbmanager', 'link-0');">dbmanager</a></tt> <tt class="py-keyword">import</tt> <tt id="link-1" class="py-name" targets="Class dbmanager.DBManager=dbmanager.DBManager-class.html"><a title="dbmanager.DBManager" class="py-name" href="#" onclick="return doclink('link-1', 'DBManager', 'link-1');">DBManager</a></tt> </tt>
<a name="L12"></a><tt class="py-lineno"> 12</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-2" class="py-name" targets="Module clock=clock-module.html"><a title="clock" class="py-name" href="#" onclick="return doclink('link-2', 'clock', 'link-2');">clock</a></tt> <tt class="py-keyword">import</tt> <tt id="link-3" class="py-name" targets="Class clock.Clock=clock.Clock-class.html"><a title="clock.Clock" class="py-name" href="#" onclick="return doclink('link-3', 'Clock', 'link-3');">Clock</a></tt> </tt>
<a name="L13"></a><tt class="py-lineno"> 13</tt>  <tt class="py-line"> </tt>
<a name="L14"></a><tt class="py-lineno"> 14</tt>  <tt class="py-line"> </tt>
<a name="AGObject"></a><div id="AGObject-def"><a name="L15"></a><tt class="py-lineno"> 15</tt> <a class="py-toggle" href="#" id="AGObject-toggle" onclick="return toggle('AGObject');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="base.AGObject-class.html">AGObject</a><tt class="py-op">:</tt> </tt>
</div><div id="AGObject-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="AGObject-expanded"><a name="L16"></a><tt class="py-lineno"> 16</tt>  <tt class="py-line">  <tt class="py-docstring">"""</tt> </tt>
<a name="L17"></a><tt class="py-lineno"> 17</tt>  <tt class="py-line"><tt class="py-docstring">  Base class for all game objects.</tt> </tt>
<a name="L18"></a><tt class="py-lineno"> 18</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L19"></a><tt class="py-lineno"> 19</tt>  <tt class="py-line"><tt class="py-docstring">  @type clock: C{L{Clock}}</tt> </tt>
<a name="L20"></a><tt class="py-lineno"> 20</tt>  <tt class="py-line"><tt class="py-docstring">  @ivar clock:</tt> </tt>
<a name="L21"></a><tt class="py-lineno"> 21</tt>  <tt class="py-line"><tt class="py-docstring">  """</tt> </tt>
<a name="L22"></a><tt class="py-lineno"> 22</tt>  <tt class="py-line">   </tt>
<a name="AGObject.__init__"></a><div id="AGObject.__init__-def"><a name="L23"></a><tt class="py-lineno"> 23</tt> <a class="py-toggle" href="#" id="AGObject.__init__-toggle" onclick="return toggle('AGObject.__init__');">-</a><tt class="py-line">  <tt class="py-keyword">def</tt> <a class="py-def-name" href="base.AGObject-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="AGObject.__init__-collapsed" style="display:none;" pad="+++" indent="++++++"></div><div id="AGObject.__init__-expanded"><a name="L24"></a><tt class="py-lineno"> 24</tt>  <tt class="py-line">    <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-4" class="py-name"><a title="clock" class="py-name" href="#" onclick="return doclink('link-4', 'clock', 'link-2');">clock</a></tt> <tt class="py-op">=</tt> <tt id="link-5" class="py-name"><a title="clock.Clock" class="py-name" href="#" onclick="return doclink('link-5', 'Clock', 'link-3');">Clock</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L25"></a><tt class="py-lineno"> 25</tt>  <tt class="py-line"> </tt>
<a name="AGObject._setattrs"></a><div id="AGObject._setattrs-def"><a name="L26"></a><tt class="py-lineno"> 26</tt> <a class="py-toggle" href="#" id="AGObject._setattrs-toggle" onclick="return toggle('AGObject._setattrs');">-</a><tt class="py-line">  <tt class="py-keyword">def</tt> <a class="py-def-name" href="base.AGObject-class.html#_setattrs">_setattrs</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">params</tt><tt class="py-op">,</tt> <tt class="py-param">values</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="AGObject._setattrs-collapsed" style="display:none;" pad="+++" indent="++++++"></div><div id="AGObject._setattrs-expanded"><a name="L27"></a><tt class="py-lineno"> 27</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L28"></a><tt class="py-lineno"> 28</tt>  <tt class="py-line"><tt class="py-docstring">    Setup instance attributes. </tt> </tt>
<a name="L29"></a><tt class="py-lineno"> 29</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L30"></a><tt class="py-lineno"> 30</tt>  <tt class="py-line"><tt class="py-docstring">    This is an auxiliary method that will set value of instance attribute if its</tt> </tt>
<a name="L31"></a><tt class="py-lineno"> 31</tt>  <tt class="py-line"><tt class="py-docstring">    name exists in C{params} and C{values} (as a key). All attributes</tt> </tt>
<a name="L32"></a><tt class="py-lineno"> 32</tt>  <tt class="py-line"><tt class="py-docstring">    whose names exist in C{params} should have default values. If there is</tt> </tt>
<a name="L33"></a><tt class="py-lineno"> 33</tt>  <tt class="py-line"><tt class="py-docstring">    no default value for attribute which does not have value defined in</tt> </tt>
<a name="L34"></a><tt class="py-lineno"> 34</tt>  <tt class="py-line"><tt class="py-docstring">    C{values} an exception is raised.</tt> </tt>
<a name="L35"></a><tt class="py-lineno"> 35</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L36"></a><tt class="py-lineno"> 36</tt>  <tt class="py-line"><tt class="py-docstring">    @type  params: string, list or tuple</tt> </tt>
<a name="L37"></a><tt class="py-lineno"> 37</tt>  <tt class="py-line"><tt class="py-docstring">    @param params: Names of allowed parameters - if string, names should be </tt> </tt>
<a name="L38"></a><tt class="py-lineno"> 38</tt>  <tt class="py-line"><tt class="py-docstring">    comma-separated</tt> </tt>
<a name="L39"></a><tt class="py-lineno"> 39</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L40"></a><tt class="py-lineno"> 40</tt>  <tt class="py-line"><tt class="py-docstring">    @type  values: dict</tt> </tt>
<a name="L41"></a><tt class="py-lineno"> 41</tt>  <tt class="py-line"><tt class="py-docstring">    @param values: Dictionary containing instance attribute values</tt> </tt>
<a name="L42"></a><tt class="py-lineno"> 42</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L43"></a><tt class="py-lineno"> 43</tt>  <tt class="py-line"> </tt>
<a name="L44"></a><tt class="py-lineno"> 44</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">type</tt><tt class="py-op">(</tt><tt class="py-name">params</tt><tt class="py-op">)</tt> <tt class="py-keyword">not</tt> <tt class="py-keyword">in</tt> <tt class="py-op">(</tt><tt class="py-name">str</tt><tt class="py-op">,</tt> <tt class="py-name">list</tt><tt class="py-op">,</tt> <tt class="py-name">tuple</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L45"></a><tt class="py-lineno"> 45</tt>  <tt class="py-line">      <tt class="py-keyword">raise</tt> <tt class="py-name">TypeError</tt><tt class="py-op">(</tt><tt class="py-string">"attribute 'params' must be a string, a list or a tuple"</tt><tt class="py-op">)</tt> </tt>
<a name="L46"></a><tt class="py-lineno"> 46</tt>  <tt class="py-line"> </tt>
<a name="L47"></a><tt class="py-lineno"> 47</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">type</tt><tt class="py-op">(</tt><tt class="py-name">values</tt><tt class="py-op">)</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">dict</tt><tt class="py-op">:</tt> </tt>
<a name="L48"></a><tt class="py-lineno"> 48</tt>  <tt class="py-line">      <tt class="py-keyword">raise</tt> <tt class="py-name">TypeError</tt><tt class="py-op">(</tt><tt class="py-string">"attribute 'values' must be a dict"</tt><tt class="py-op">)</tt> </tt>
<a name="L49"></a><tt class="py-lineno"> 49</tt>  <tt class="py-line"> </tt>
<a name="L50"></a><tt class="py-lineno"> 50</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">type</tt><tt class="py-op">(</tt><tt class="py-name">params</tt><tt class="py-op">)</tt> <tt class="py-keyword">is</tt> <tt class="py-name">str</tt><tt class="py-op">:</tt> </tt>
<a name="L51"></a><tt class="py-lineno"> 51</tt>  <tt class="py-line">      <tt class="py-name">params</tt> <tt class="py-op">=</tt> <tt class="py-name">params</tt><tt class="py-op">.</tt><tt class="py-name">split</tt><tt class="py-op">(</tt><tt class="py-string">','</tt><tt class="py-op">)</tt> </tt>
<a name="L52"></a><tt class="py-lineno"> 52</tt>  <tt class="py-line">      <tt class="py-name">params</tt> <tt class="py-op">=</tt> <tt class="py-name">map</tt><tt class="py-op">(</tt><tt class="py-keyword">lambda</tt> <tt class="py-name">s</tt><tt class="py-op">:</tt> <tt class="py-name">s</tt><tt class="py-op">.</tt><tt class="py-name">strip</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">params</tt><tt class="py-op">)</tt> </tt>
<a name="L53"></a><tt class="py-lineno"> 53</tt>  <tt class="py-line"> </tt>
<a name="L54"></a><tt class="py-lineno"> 54</tt>  <tt class="py-line">    <tt class="py-keyword">for</tt> <tt class="py-name">name</tt> <tt class="py-keyword">in</tt> <tt class="py-name">params</tt><tt class="py-op">:</tt> </tt>
<a name="L55"></a><tt class="py-lineno"> 55</tt>  <tt class="py-line">      <tt class="py-keyword">if</tt> <tt class="py-name">name</tt> <tt class="py-keyword">in</tt> <tt class="py-name">values</tt><tt class="py-op">.</tt><tt class="py-name">keys</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L56"></a><tt class="py-lineno"> 56</tt>  <tt class="py-line">        <tt class="py-name">setattr</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt class="py-name">name</tt><tt class="py-op">,</tt> <tt class="py-name">values</tt><tt class="py-op">[</tt><tt class="py-name">name</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L57"></a><tt class="py-lineno"> 57</tt>  <tt class="py-line">      <tt class="py-keyword">elif</tt> <tt class="py-keyword">not</tt> <tt class="py-name">hasattr</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt class="py-name">name</tt><tt class="py-op">)</tt><tt class="py-op">:</tt>  </tt>
<a name="L58"></a><tt class="py-lineno"> 58</tt>  <tt class="py-line">        <tt class="py-name">v</tt> <tt class="py-op">=</tt> <tt class="py-string">"%s.%s does not have any value defined"</tt> <tt class="py-op">%</tt> \ </tt>
<a name="L59"></a><tt class="py-lineno"> 59</tt>  <tt class="py-line">            <tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__class__</tt><tt class="py-op">.</tt><tt class="py-name">__name__</tt><tt class="py-op">,</tt> <tt class="py-name">name</tt><tt class="py-op">)</tt> </tt>
<a name="L60"></a><tt class="py-lineno"> 60</tt>  <tt class="py-line">        <tt class="py-keyword">raise</tt> <tt class="py-name">ValueError</tt><tt class="py-op">(</tt><tt class="py-name">v</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L61"></a><tt class="py-lineno"> 61</tt>  <tt class="py-line"> </tt>
<a name="L62"></a><tt class="py-lineno"> 62</tt>  <tt class="py-line"> </tt>
<a name="Overlay"></a><div id="Overlay-def"><a name="L63"></a><tt class="py-lineno"> 63</tt> <a class="py-toggle" href="#" id="Overlay-toggle" onclick="return toggle('Overlay');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="base.Overlay-class.html">Overlay</a><tt class="py-op">(</tt><tt class="py-base-class">pygame</tt><tt class="py-op">.</tt><tt class="py-base-class">sprite</tt><tt class="py-op">.</tt><tt class="py-base-class">Sprite</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Overlay-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="Overlay-expanded"><a name="L64"></a><tt class="py-lineno"> 64</tt>  <tt class="py-line">  <tt class="py-docstring">"""</tt> </tt>
<a name="L65"></a><tt class="py-lineno"> 65</tt>  <tt class="py-line"><tt class="py-docstring">  Overlay can be used to display auxiliary animated effects over a sprite.</tt> </tt>
<a name="L66"></a><tt class="py-lineno"> 66</tt>  <tt class="py-line"><tt class="py-docstring">  Overlays are not independent game objects. Overlays do not contain</tt> </tt>
<a name="L67"></a><tt class="py-lineno"> 67</tt>  <tt class="py-line"><tt class="py-docstring">  any graphics resources on their own. Overlays do not collide. Overlay's</tt> </tt>
<a name="L68"></a><tt class="py-lineno"> 68</tt>  <tt class="py-line"><tt class="py-docstring">  image size is changed dynamically. Overlay's image has to be initialized </tt> </tt>
<a name="L69"></a><tt class="py-lineno"> 69</tt>  <tt class="py-line"><tt class="py-docstring">  with owner's image in order to preserve surface properites. Overlay itself</tt> </tt>
<a name="L70"></a><tt class="py-lineno"> 70</tt>  <tt class="py-line"><tt class="py-docstring">  should be added to group 'draw' immediatelly after its owner is added to</tt> </tt>
<a name="L71"></a><tt class="py-lineno"> 71</tt>  <tt class="py-line"><tt class="py-docstring">  that groups in order to display properly (not to display over other </tt> </tt>
<a name="L72"></a><tt class="py-lineno"> 72</tt>  <tt class="py-line"><tt class="py-docstring">  objects).</tt> </tt>
<a name="L73"></a><tt class="py-lineno"> 73</tt>  <tt class="py-line"><tt class="py-docstring">  """</tt> </tt>
<a name="L74"></a><tt class="py-lineno"> 74</tt>  <tt class="py-line"> </tt>
<a name="Overlay.__init__"></a><div id="Overlay.__init__-def"><a name="L75"></a><tt class="py-lineno"> 75</tt> <a class="py-toggle" href="#" id="Overlay.__init__-toggle" onclick="return toggle('Overlay.__init__');">-</a><tt class="py-line">  <tt class="py-keyword">def</tt> <a class="py-def-name" href="base.Overlay-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-op">*</tt><tt class="py-param">groups</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Overlay.__init__-collapsed" style="display:none;" pad="+++" indent="++++++"></div><div id="Overlay.__init__-expanded"><a name="L76"></a><tt class="py-lineno"> 76</tt>  <tt class="py-line">    <tt class="py-name">pygame</tt><tt class="py-op">.</tt><tt class="py-name">sprite</tt><tt class="py-op">.</tt><tt class="py-name">Sprite</tt><tt class="py-op">.</tt><tt id="link-6" class="py-name" targets="Method application.AGApplication.__init__()=application.AGApplication-class.html#__init__,Method application.AGLevel.__init__()=application.AGLevel-class.html#__init__,Method application.AGMenu.__init__()=application.AGMenu-class.html#__init__,Method background.BackgroundImage.__init__()=background.BackgroundImage-class.html#__init__,Method background.BackgroundObject.__init__()=background.BackgroundObject-class.html#__init__,Method background.CloserStar.__init__()=background.CloserStar-class.html#__init__,Method background.CloserStarCluster.__init__()=background.CloserStarCluster-class.html#__init__,Method background.DistantStar.__init__()=background.DistantStar-class.html#__init__,Method background.SpaceBackground.__init__()=background.SpaceBackground-class.html#__init__,Method base.AGObject.__init__()=base.AGObject-class.html#__init__,Method base.Overlay.__init__()=base.Overlay-class.html#__init__,Method clock.Clock.__init__()=clock.Clock-class.html#__init__,Method hud.Hud.__init__()=hud.Hud-class.html#__init__,Method mover.CircularMover.__init__()=mover.CircularMover-class.html#__init__,Method mover.LinearMover.__init__()=mover.LinearMover-class.html#__init__,Method mover.LinearPlayerTargetingMover.__init__()=mover.LinearPlayerTargetingMover-class.html#__init__,Method mover.Mover.__init__()=mover.Mover-class.html#__init__,Method mover.RandomMover.__init__()=mover.RandomMover-class.html#__init__,Method mover.SeekingMover.__init__()=mover.SeekingMover-class.html#__init__,Method mover.ZigZagMover.__init__()=mover.ZigZagMover-class.html#__init__,Method obstacle.MovingObstacle.__init__()=obstacle.MovingObstacle-class.html#__init__,Method obstacle.Obstacle.__init__()=obstacle.Obstacle-class.html#__init__,Method signals.Signal.__init__()=signals.Signal-class.html#__init__,Method signals.WeakMethod.__init__()=signals.WeakMethod-class.html#__init__,Method signals._WeakMethod_FuncHost.__init__()=signals._WeakMethod_FuncHost-class.html#__init__,Method spaceship.AGSprite.__init__()=spaceship.AGSprite-class.html#__init__,Method spaceship.AmmoConsumingItem.__init__()=spaceship.AmmoConsumingItem-class.html#__init__,Method spaceship.AmmoWeapon.__init__()=spaceship.AmmoWeapon-class.html#__init__,Method spaceship.Armour.__init__()=spaceship.Armour-class.html#__init__,Method spaceship.AutoShield.__init__()=spaceship.AutoShield-class.html#__init__,Method spaceship.BasicArmour.__init__()=spaceship.BasicArmour-class.html#__init__,Method spaceship.BasicReactor.__init__()=spaceship.BasicReactor-class.html#__init__,Method spaceship.Bonus.__init__()=spaceship.Bonus-class.html#__init__,Method spaceship.Destructible.__init__()=spaceship.Destructible-class.html#__init__,Method spaceship.EnemyMine.__init__()=spaceship.EnemyMine-class.html#__init__,Method spaceship.EnemyShip.__init__()=spaceship.EnemyShip-class.html#__init__,Method spaceship.EnergyConsumingItem.__init__()=spaceship.EnergyConsumingItem-class.html#__init__,Method spaceship.EnergyProjectileExplosion.__init__()=spaceship.EnergyProjectileExplosion-class.html#__init__,Method spaceship.EnergyWeapon.__init__()=spaceship.EnergyWeapon-class.html#__init__,Method spaceship.Explosion.__init__()=spaceship.Explosion-class.html#__init__,Method spaceship.InstantEnergyBeam.__init__()=spaceship.InstantEnergyBeam-class.html#__init__,Method spaceship.InstantEnergyWeapon.__init__()=spaceship.InstantEnergyWeapon-class.html#__init__,Method spaceship.MultiCannon.__init__()=spaceship.MultiCannon-class.html#__init__,Method spaceship.MultiShotProjectileWeapon.__init__()=spaceship.MultiShotProjectileWeapon-class.html#__init__,Method spaceship.PlayerShip.__init__()=spaceship.PlayerShip-class.html#__init__,Method spaceship.Projectile.__init__()=spaceship.Projectile-class.html#__init__,Method spaceship.ProjectileAmmoWeapon.__init__()=spaceship.ProjectileAmmoWeapon-class.html#__init__,Method spaceship.ProjectileEnergyWeapon.__init__()=spaceship.ProjectileEnergyWeapon-class.html#__init__,Method spaceship.Reactor.__init__()=spaceship.Reactor-class.html#__init__,Method spaceship.RechargeBonus.__init__()=spaceship.RechargeBonus-class.html#__init__,Method spaceship.ScatteringProjectile.__init__()=spaceship.ScatteringProjectile-class.html#__init__,Method spaceship.SeekingProjectile.__init__()=spaceship.SeekingProjectile-class.html#__init__,Method spaceship.Shield.__init__()=spaceship.Shield-class.html#__init__,Method spaceship.ShieldUpgradeBonus.__init__()=spaceship.ShieldUpgradeBonus-class.html#__init__,Method spaceship.Ship.__init__()=spaceship.Ship-class.html#__init__,Method spaceship.SuperShield.__init__()=spaceship.SuperShield-class.html#__init__,Method spaceship.TargetedProjectileAmmoWeapon.__init__()=spaceship.TargetedProjectileAmmoWeapon-class.html#__init__,Method spaceship.TargetedProjectileEnergyWeapon.__init__()=spaceship.TargetedProjectileEnergyWeapon-class.html#__init__,Method spaceship.TargetedProjectileWeapon.__init__()=spaceship.TargetedProjectileWeapon-class.html#__init__,Method spaceship.Weapon.__init__()=spaceship.Weapon-class.html#__init__,Method widgets.VerticalProgressBar.__init__()=widgets.VerticalProgressBar-class.html#__init__,Method widgets.Widget.__init__()=widgets.Widget-class.html#__init__"><a title="application.AGApplication.__init__
application.AGLevel.__init__
application.AGMenu.__init__
background.BackgroundImage.__init__
background.BackgroundObject.__init__
background.CloserStar.__init__
background.CloserStarCluster.__init__
background.DistantStar.__init__
background.SpaceBackground.__init__
base.AGObject.__init__
base.Overlay.__init__
clock.Clock.__init__
hud.Hud.__init__
mover.CircularMover.__init__
mover.LinearMover.__init__
mover.LinearPlayerTargetingMover.__init__
mover.Mover.__init__
mover.RandomMover.__init__
mover.SeekingMover.__init__
mover.ZigZagMover.__init__
obstacle.MovingObstacle.__init__
obstacle.Obstacle.__init__
signals.Signal.__init__
signals.WeakMethod.__init__
signals._WeakMethod_FuncHost.__init__
spaceship.AGSprite.__init__
spaceship.AmmoConsumingItem.__init__
spaceship.AmmoWeapon.__init__
spaceship.Armour.__init__
spaceship.AutoShield.__init__
spaceship.BasicArmour.__init__
spaceship.BasicReactor.__init__
spaceship.Bonus.__init__
spaceship.Destructible.__init__
spaceship.EnemyMine.__init__
spaceship.EnemyShip.__init__
spaceship.EnergyConsumingItem.__init__
spaceship.EnergyProjectileExplosion.__init__
spaceship.EnergyWeapon.__init__
spaceship.Explosion.__init__
spaceship.InstantEnergyBeam.__init__
spaceship.InstantEnergyWeapon.__init__
spaceship.MultiCannon.__init__
spaceship.MultiShotProjectileWeapon.__init__
spaceship.PlayerShip.__init__
spaceship.Projectile.__init__
spaceship.ProjectileAmmoWeapon.__init__
spaceship.ProjectileEnergyWeapon.__init__
spaceship.Reactor.__init__
spaceship.RechargeBonus.__init__
spaceship.ScatteringProjectile.__init__
spaceship.SeekingProjectile.__init__
spaceship.Shield.__init__
spaceship.ShieldUpgradeBonus.__init__
spaceship.Ship.__init__
spaceship.SuperShield.__init__
spaceship.TargetedProjectileAmmoWeapon.__init__
spaceship.TargetedProjectileEnergyWeapon.__init__
spaceship.TargetedProjectileWeapon.__init__
spaceship.Weapon.__init__
widgets.VerticalProgressBar.__init__
widgets.Widget.__init__" class="py-name" href="#" onclick="return doclink('link-6', '__init__', 'link-6');">__init__</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt class="py-op">*</tt><tt class="py-name">groups</tt><tt class="py-op">)</tt> </tt>
<a name="L77"></a><tt class="py-lineno"> 77</tt>  <tt class="py-line"> </tt>
<a name="L78"></a><tt class="py-lineno"> 78</tt>  <tt class="py-line">    <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">rect</tt> <tt class="py-op">=</tt> <tt id="link-7" class="py-name" targets="Class base.AGRect=base.AGRect-class.html"><a title="base.AGRect" class="py-name" href="#" onclick="return doclink('link-7', 'AGRect', 'link-7');">AGRect</a></tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L79"></a><tt class="py-lineno"> 79</tt>  <tt class="py-line">    <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">image</tt> <tt class="py-op">=</tt> <tt class="py-name">pygame</tt><tt class="py-op">.</tt><tt class="py-name">Surface</tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">pygame</tt><tt class="py-op">.</tt><tt class="py-name">SRCALPHA</tt><tt class="py-op">)</tt> </tt>
</div><a name="L80"></a><tt class="py-lineno"> 80</tt>  <tt class="py-line"> </tt>
<a name="Overlay.init_image"></a><div id="Overlay.init_image-def"><a name="L81"></a><tt class="py-lineno"> 81</tt> <a class="py-toggle" href="#" id="Overlay.init_image-toggle" onclick="return toggle('Overlay.init_image');">-</a><tt class="py-line">  <tt class="py-keyword">def</tt> <a class="py-def-name" href="base.Overlay-class.html#init_image">init_image</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">owner_image</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Overlay.init_image-collapsed" style="display:none;" pad="+++" indent="++++++"></div><div id="Overlay.init_image-expanded"><a name="L82"></a><tt class="py-lineno"> 82</tt>  <tt class="py-line">    <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">image</tt> <tt class="py-op">=</tt> <tt class="py-name">pygame</tt><tt class="py-op">.</tt><tt class="py-name">Surface</tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">pygame</tt><tt class="py-op">.</tt><tt class="py-name">SRCALPHA</tt><tt class="py-op">,</tt> <tt class="py-name">owner_image</tt><tt class="py-op">)</tt> </tt>
</div><a name="L83"></a><tt class="py-lineno"> 83</tt>  <tt class="py-line"> </tt>
<a name="Overlay.has_image"></a><div id="Overlay.has_image-def"><a name="L84"></a><tt class="py-lineno"> 84</tt> <a class="py-toggle" href="#" id="Overlay.has_image-toggle" onclick="return toggle('Overlay.has_image');">-</a><tt class="py-line">  <tt class="py-keyword">def</tt> <a class="py-def-name" href="base.Overlay-class.html#has_image">has_image</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Overlay.has_image-collapsed" style="display:none;" pad="+++" indent="++++++"></div><div id="Overlay.has_image-expanded"><a name="L85"></a><tt class="py-lineno"> 85</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">image</tt><tt class="py-op">.</tt><tt class="py-name">get_size</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-op">!=</tt> <tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
</div><a name="L86"></a><tt class="py-lineno"> 86</tt>  <tt class="py-line"> </tt>
<a name="Overlay.fill"></a><div id="Overlay.fill-def"><a name="L87"></a><tt class="py-lineno"> 87</tt> <a class="py-toggle" href="#" id="Overlay.fill-toggle" onclick="return toggle('Overlay.fill');">-</a><tt class="py-line">  <tt class="py-keyword">def</tt> <a class="py-def-name" href="base.Overlay-class.html#fill">fill</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">colour</tt><tt class="py-op">,</tt> <tt class="py-param">rect</tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Overlay.fill-collapsed" style="display:none;" pad="+++" indent="++++++"></div><div id="Overlay.fill-expanded"><a name="L88"></a><tt class="py-lineno"> 88</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L89"></a><tt class="py-lineno"> 89</tt>  <tt class="py-line"><tt class="py-docstring">    Fill overlay fragment with C{colour}.</tt> </tt>
<a name="L90"></a><tt class="py-lineno"> 90</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L91"></a><tt class="py-lineno"> 91</tt>  <tt class="py-line"><tt class="py-docstring">    @type  colour: sequence</tt> </tt>
<a name="L92"></a><tt class="py-lineno"> 92</tt>  <tt class="py-line"><tt class="py-docstring">    @param colour: Fill colour</tt> </tt>
<a name="L93"></a><tt class="py-lineno"> 93</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L94"></a><tt class="py-lineno"> 94</tt>  <tt class="py-line"><tt class="py-docstring">    @type  rect: C{L{AGRect}} or C{None}</tt> </tt>
<a name="L95"></a><tt class="py-lineno"> 95</tt>  <tt class="py-line"><tt class="py-docstring">    @param rect: Area to be filled. Size and coordinates of top-left</tt> </tt>
<a name="L96"></a><tt class="py-lineno"> 96</tt>  <tt class="py-line"><tt class="py-docstring">    corner of area relative to overlay center. If C{None} entire</tt> </tt>
<a name="L97"></a><tt class="py-lineno"> 97</tt>  <tt class="py-line"><tt class="py-docstring">    overlay area is filled.</tt> </tt>
<a name="L98"></a><tt class="py-lineno"> 98</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L99"></a><tt class="py-lineno"> 99</tt>  <tt class="py-line"> </tt>
<a name="L100"></a><tt class="py-lineno">100</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">rect</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L101"></a><tt class="py-lineno">101</tt>  <tt class="py-line">      <tt class="py-name">rect</tt> <tt class="py-op">=</tt> <tt id="link-8" class="py-name"><a title="base.AGRect" class="py-name" href="#" onclick="return doclink('link-8', 'AGRect', 'link-7');">AGRect</a></tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">image</tt><tt class="py-op">.</tt><tt class="py-name">get_size</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L102"></a><tt class="py-lineno">102</tt>  <tt class="py-line">    <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L103"></a><tt class="py-lineno">103</tt>  <tt class="py-line">      <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-9" class="py-name" targets="Method base.Overlay.resize()=base.Overlay-class.html#resize"><a title="base.Overlay.resize" class="py-name" href="#" onclick="return doclink('link-9', 'resize', 'link-9');">resize</a></tt><tt class="py-op">(</tt><tt class="py-name">rect</tt><tt class="py-op">.</tt><tt class="py-name">size</tt><tt class="py-op">)</tt> </tt>
<a name="L104"></a><tt class="py-lineno">104</tt>  <tt class="py-line">      <tt class="py-name">rect</tt> <tt class="py-op">=</tt> <tt id="link-10" class="py-name"><a title="base.AGRect" class="py-name" href="#" onclick="return doclink('link-10', 'AGRect', 'link-7');">AGRect</a></tt><tt class="py-op">(</tt><tt class="py-name">rect</tt><tt class="py-op">)</tt> </tt>
<a name="L105"></a><tt class="py-lineno">105</tt>  <tt class="py-line">       </tt>
<a name="L106"></a><tt class="py-lineno">106</tt>  <tt class="py-line">      <tt class="py-name">rect</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> <tt class="py-op">+=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">rect</tt><tt class="py-op">.</tt><tt class="py-name">width</tt> <tt class="py-op">/</tt> <tt class="py-number">2.</tt> </tt>
<a name="L107"></a><tt class="py-lineno">107</tt>  <tt class="py-line">      <tt class="py-name">rect</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> <tt class="py-op">+=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">rect</tt><tt class="py-op">.</tt><tt class="py-name">height</tt> <tt class="py-op">/</tt> <tt class="py-number">2.</tt> </tt>
<a name="L108"></a><tt class="py-lineno">108</tt>  <tt class="py-line"> </tt>
<a name="L109"></a><tt class="py-lineno">109</tt>  <tt class="py-line">    <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">image</tt><tt class="py-op">.</tt><tt id="link-11" class="py-name" targets="Method base.Overlay.fill()=base.Overlay-class.html#fill"><a title="base.Overlay.fill" class="py-name" href="#" onclick="return doclink('link-11', 'fill', 'link-11');">fill</a></tt><tt class="py-op">(</tt><tt class="py-name">colour</tt><tt class="py-op">,</tt> <tt class="py-name">rect</tt><tt class="py-op">)</tt> </tt>
</div><a name="L110"></a><tt class="py-lineno">110</tt>  <tt class="py-line"> </tt>
<a name="Overlay.clear"></a><div id="Overlay.clear-def"><a name="L111"></a><tt class="py-lineno">111</tt> <a class="py-toggle" href="#" id="Overlay.clear-toggle" onclick="return toggle('Overlay.clear');">-</a><tt class="py-line">  <tt class="py-keyword">def</tt> <a class="py-def-name" href="base.Overlay-class.html#clear">clear</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">rect</tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Overlay.clear-collapsed" style="display:none;" pad="+++" indent="++++++"></div><div id="Overlay.clear-expanded"><a name="L112"></a><tt class="py-lineno">112</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L113"></a><tt class="py-lineno">113</tt>  <tt class="py-line"><tt class="py-docstring">    Clear overlay fragment.</tt> </tt>
<a name="L114"></a><tt class="py-lineno">114</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L115"></a><tt class="py-lineno">115</tt>  <tt class="py-line"><tt class="py-docstring">    @type  rect: C{L{AGRect}} or C{None}</tt> </tt>
<a name="L116"></a><tt class="py-lineno">116</tt>  <tt class="py-line"><tt class="py-docstring">    @param rect: Area to be cleared. Size and coordinates of top-left</tt> </tt>
<a name="L117"></a><tt class="py-lineno">117</tt>  <tt class="py-line"><tt class="py-docstring">    corner of area relative to overlay center. If C{None} entire</tt> </tt>
<a name="L118"></a><tt class="py-lineno">118</tt>  <tt class="py-line"><tt class="py-docstring">    overlay area is cleared.</tt> </tt>
<a name="L119"></a><tt class="py-lineno">119</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L120"></a><tt class="py-lineno">120</tt>  <tt class="py-line"> </tt>
<a name="L121"></a><tt class="py-lineno">121</tt>  <tt class="py-line">    <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-12" class="py-name"><a title="base.Overlay.fill" class="py-name" href="#" onclick="return doclink('link-12', 'fill', 'link-11');">fill</a></tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">rect</tt><tt class="py-op">)</tt> </tt>
</div><a name="L122"></a><tt class="py-lineno">122</tt>  <tt class="py-line"> </tt>
<a name="Overlay.blit"></a><div id="Overlay.blit-def"><a name="L123"></a><tt class="py-lineno">123</tt> <a class="py-toggle" href="#" id="Overlay.blit-toggle" onclick="return toggle('Overlay.blit');">-</a><tt class="py-line">  <tt class="py-keyword">def</tt> <a class="py-def-name" href="base.Overlay-class.html#blit">blit</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">image</tt><tt class="py-op">,</tt> <tt class="py-param">dest</tt><tt class="py-op">,</tt> <tt class="py-param">area</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Overlay.blit-collapsed" style="display:none;" pad="+++" indent="++++++"></div><div id="Overlay.blit-expanded"><a name="L124"></a><tt class="py-lineno">124</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L125"></a><tt class="py-lineno">125</tt>  <tt class="py-line"><tt class="py-docstring">    Blit C{image} on overlay.</tt> </tt>
<a name="L126"></a><tt class="py-lineno">126</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L127"></a><tt class="py-lineno">127</tt>  <tt class="py-line"><tt class="py-docstring">    @type  image: C{pygame.Surface}</tt> </tt>
<a name="L128"></a><tt class="py-lineno">128</tt>  <tt class="py-line"><tt class="py-docstring">    @param image: Image to blit</tt> </tt>
<a name="L129"></a><tt class="py-lineno">129</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L130"></a><tt class="py-lineno">130</tt>  <tt class="py-line"><tt class="py-docstring">    @type  dest: sequence</tt> </tt>
<a name="L131"></a><tt class="py-lineno">131</tt>  <tt class="py-line"><tt class="py-docstring">    @param dest: Position of top-left corner of image relative to overlay</tt> </tt>
<a name="L132"></a><tt class="py-lineno">132</tt>  <tt class="py-line"><tt class="py-docstring">    center.</tt> </tt>
<a name="L133"></a><tt class="py-lineno">133</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L134"></a><tt class="py-lineno">134</tt>  <tt class="py-line"><tt class="py-docstring">    @type  area: C{L{AGRect}}</tt> </tt>
<a name="L135"></a><tt class="py-lineno">135</tt>  <tt class="py-line"><tt class="py-docstring">    @param area: Image fragment to be blit.</tt> </tt>
<a name="L136"></a><tt class="py-lineno">136</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L137"></a><tt class="py-lineno">137</tt>  <tt class="py-line"> </tt>
<a name="L138"></a><tt class="py-lineno">138</tt>  <tt class="py-line">    <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-13" class="py-name"><a title="base.Overlay.resize" class="py-name" href="#" onclick="return doclink('link-13', 'resize', 'link-9');">resize</a></tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-name">fabs</tt><tt class="py-op">(</tt><tt class="py-name">dest</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> <tt class="py-op">+</tt> <tt class="py-name">area</tt><tt class="py-op">.</tt><tt class="py-name">width</tt><tt class="py-op">,</tt> <tt class="py-name">fabs</tt><tt class="py-op">(</tt><tt class="py-name">dest</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> <tt class="py-op">+</tt> <tt class="py-name">area</tt><tt class="py-op">.</tt><tt class="py-name">height</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L139"></a><tt class="py-lineno">139</tt>  <tt class="py-line"> </tt>
<a name="L140"></a><tt class="py-lineno">140</tt>  <tt class="py-line">    <tt class="py-name">dest</tt> <tt class="py-op">=</tt> <tt class="py-name">list</tt><tt class="py-op">(</tt><tt class="py-name">dest</tt><tt class="py-op">)</tt> </tt>
<a name="L141"></a><tt class="py-lineno">141</tt>  <tt class="py-line">    <tt class="py-name">dest</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> <tt class="py-op">+=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">rect</tt><tt class="py-op">.</tt><tt class="py-name">width</tt> <tt class="py-op">/</tt> <tt class="py-number">2.</tt> </tt>
<a name="L142"></a><tt class="py-lineno">142</tt>  <tt class="py-line">    <tt class="py-name">dest</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> <tt class="py-op">+=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">rect</tt><tt class="py-op">.</tt><tt class="py-name">height</tt> <tt class="py-op">/</tt> <tt class="py-number">2.</tt> </tt>
<a name="L143"></a><tt class="py-lineno">143</tt>  <tt class="py-line"> </tt>
<a name="L144"></a><tt class="py-lineno">144</tt>  <tt class="py-line">    <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">image</tt><tt class="py-op">.</tt><tt id="link-14" class="py-name" targets="Method base.Overlay.blit()=base.Overlay-class.html#blit"><a title="base.Overlay.blit" class="py-name" href="#" onclick="return doclink('link-14', 'blit', 'link-14');">blit</a></tt><tt class="py-op">(</tt><tt class="py-name">image</tt><tt class="py-op">,</tt> <tt class="py-name">dest</tt><tt class="py-op">,</tt> <tt class="py-name">area</tt><tt class="py-op">)</tt> </tt>
</div><a name="L145"></a><tt class="py-lineno">145</tt>  <tt class="py-line"> </tt>
<a name="Overlay.resize"></a><div id="Overlay.resize-def"><a name="L146"></a><tt class="py-lineno">146</tt> <a class="py-toggle" href="#" id="Overlay.resize-toggle" onclick="return toggle('Overlay.resize');">-</a><tt class="py-line">  <tt class="py-keyword">def</tt> <a class="py-def-name" href="base.Overlay-class.html#resize">resize</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">dest</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Overlay.resize-collapsed" style="display:none;" pad="+++" indent="++++++"></div><div id="Overlay.resize-expanded"><a name="L147"></a><tt class="py-lineno">147</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L148"></a><tt class="py-lineno">148</tt>  <tt class="py-line"><tt class="py-docstring">    If needed resize overlay to fit C{dest}.</tt> </tt>
<a name="L149"></a><tt class="py-lineno">149</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L150"></a><tt class="py-lineno">150</tt>  <tt class="py-line"><tt class="py-docstring">    Warning. Overlay content is not preserved (yet) which may</tt> </tt>
<a name="L151"></a><tt class="py-lineno">151</tt>  <tt class="py-line"><tt class="py-docstring">    cause filcker or other negative effects.</tt> </tt>
<a name="L152"></a><tt class="py-lineno">152</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L153"></a><tt class="py-lineno">153</tt>  <tt class="py-line"><tt class="py-docstring">    @type  dest: sequence</tt> </tt>
<a name="L154"></a><tt class="py-lineno">154</tt>  <tt class="py-line"><tt class="py-docstring">    @param dest: Area needed for new blit.</tt> </tt>
<a name="L155"></a><tt class="py-lineno">155</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L156"></a><tt class="py-lineno">156</tt>  <tt class="py-line"> </tt>
<a name="L157"></a><tt class="py-lineno">157</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-number">2</tt> <tt class="py-op">*</tt> <tt class="py-name">dest</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> <tt class="py-op">&lt;=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">rect</tt><tt class="py-op">.</tt><tt class="py-name">width</tt> <tt class="py-keyword">and</tt> <tt class="py-number">2</tt> <tt class="py-op">*</tt> <tt class="py-name">dest</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> <tt class="py-op">&lt;=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">rect</tt><tt class="py-op">.</tt><tt class="py-name">height</tt><tt class="py-op">:</tt> </tt>
<a name="L158"></a><tt class="py-lineno">158</tt>  <tt class="py-line">      <tt class="py-keyword">return</tt> </tt>
<a name="L159"></a><tt class="py-lineno">159</tt>  <tt class="py-line"> </tt>
<a name="L160"></a><tt class="py-lineno">160</tt>  <tt class="py-line">    <tt class="py-name">center</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">rect</tt><tt class="py-op">.</tt><tt class="py-name">center</tt> </tt>
<a name="L161"></a><tt class="py-lineno">161</tt>  <tt class="py-line"> </tt>
<a name="L162"></a><tt class="py-lineno">162</tt>  <tt class="py-line">    <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">rect</tt><tt class="py-op">.</tt><tt class="py-name">inflate_ip</tt><tt class="py-op">(</tt><tt class="py-number">2</tt> <tt class="py-op">*</tt> <tt class="py-name">dest</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt class="py-number">2</tt> <tt class="py-op">*</tt> <tt class="py-name">dest</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L163"></a><tt class="py-lineno">163</tt>  <tt class="py-line">    <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">rect</tt><tt class="py-op">.</tt><tt class="py-name">center</tt> <tt class="py-op">=</tt> <tt class="py-name">center</tt> </tt>
<a name="L164"></a><tt class="py-lineno">164</tt>  <tt class="py-line"> </tt>
<a name="L165"></a><tt class="py-lineno">165</tt>  <tt class="py-line">    <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">image</tt> <tt class="py-op">=</tt> <tt class="py-name">pygame</tt><tt class="py-op">.</tt><tt class="py-name">Surface</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">rect</tt><tt class="py-op">.</tt><tt class="py-name">size</tt><tt class="py-op">,</tt> <tt class="py-name">pygame</tt><tt class="py-op">.</tt><tt class="py-name">SRCALPHA</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">image</tt><tt class="py-op">)</tt> </tt>
</div><a name="L166"></a><tt class="py-lineno">166</tt>  <tt class="py-line"> </tt>
<a name="Overlay.align"></a><div id="Overlay.align-def"><a name="L167"></a><tt class="py-lineno">167</tt> <a class="py-toggle" href="#" id="Overlay.align-toggle" onclick="return toggle('Overlay.align');">-</a><tt class="py-line">  <tt class="py-keyword">def</tt> <a class="py-def-name" href="base.Overlay-class.html#align">align</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">pos</tt><tt class="py-op">,</tt> <tt class="py-param">align</tt> <tt class="py-op">=</tt> <tt class="py-string">'center'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Overlay.align-collapsed" style="display:none;" pad="+++" indent="++++++"></div><div id="Overlay.align-expanded"><a name="L168"></a><tt class="py-lineno">168</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L169"></a><tt class="py-lineno">169</tt>  <tt class="py-line"><tt class="py-docstring">    Position overlay.</tt> </tt>
<a name="L170"></a><tt class="py-lineno">170</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L171"></a><tt class="py-lineno">171</tt>  <tt class="py-line"><tt class="py-docstring">    @type  pos: sequence</tt> </tt>
<a name="L172"></a><tt class="py-lineno">172</tt>  <tt class="py-line"><tt class="py-docstring">    @param pos: Position in global coordinate system.</tt> </tt>
<a name="L173"></a><tt class="py-lineno">173</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L174"></a><tt class="py-lineno">174</tt>  <tt class="py-line"> </tt>
<a name="L175"></a><tt class="py-lineno">175</tt>  <tt class="py-line">    <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">rect</tt><tt class="py-op">.</tt><tt id="link-15" class="py-name" targets="Method base.AGRect.align()=base.AGRect-class.html#align,Method base.Overlay.align()=base.Overlay-class.html#align"><a title="base.AGRect.align
base.Overlay.align" class="py-name" href="#" onclick="return doclink('link-15', 'align', 'link-15');">align</a></tt><tt class="py-op">(</tt><tt class="py-name">pos</tt><tt class="py-op">,</tt> <tt id="link-16" class="py-name"><a title="base.AGRect.align
base.Overlay.align" class="py-name" href="#" onclick="return doclink('link-16', 'align', 'link-15');">align</a></tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L176"></a><tt class="py-lineno">176</tt>  <tt class="py-line"> </tt>
<a name="L177"></a><tt class="py-lineno">177</tt>  <tt class="py-line"> </tt>
<a name="AGRect"></a><div id="AGRect-def"><a name="L178"></a><tt class="py-lineno">178</tt> <a class="py-toggle" href="#" id="AGRect-toggle" onclick="return toggle('AGRect');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="base.AGRect-class.html">AGRect</a><tt class="py-op">(</tt><tt class="py-base-class">pygame</tt><tt class="py-op">.</tt><tt class="py-base-class">Rect</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="AGRect-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="AGRect-expanded"><a name="L179"></a><tt class="py-lineno">179</tt>  <tt class="py-line">  <tt class="py-docstring">"""</tt> </tt>
<a name="L180"></a><tt class="py-lineno">180</tt>  <tt class="py-line"><tt class="py-docstring">  C{pygame.Rect} with extended functionality.</tt> </tt>
<a name="L181"></a><tt class="py-lineno">181</tt>  <tt class="py-line"><tt class="py-docstring">  """</tt> </tt>
<a name="L182"></a><tt class="py-lineno">182</tt>  <tt class="py-line"> </tt>
<a name="AGRect.align"></a><div id="AGRect.align-def"><a name="L183"></a><tt class="py-lineno">183</tt> <a class="py-toggle" href="#" id="AGRect.align-toggle" onclick="return toggle('AGRect.align');">-</a><tt class="py-line">  <tt class="py-keyword">def</tt> <a class="py-def-name" href="base.AGRect-class.html#align">align</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">pos</tt><tt class="py-op">,</tt> <tt class="py-param">align</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="AGRect.align-collapsed" style="display:none;" pad="+++" indent="++++++"></div><div id="AGRect.align-expanded"><a name="L184"></a><tt class="py-lineno">184</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L185"></a><tt class="py-lineno">185</tt>  <tt class="py-line"><tt class="py-docstring">    Position rectangle using C{pygame.Rect} properties such as 'topleft',</tt> </tt>
<a name="L186"></a><tt class="py-lineno">186</tt>  <tt class="py-line"><tt class="py-docstring">    'center' or pairs of properties such as ('top', left'), ('bottom',</tt> </tt>
<a name="L187"></a><tt class="py-lineno">187</tt>  <tt class="py-line"><tt class="py-docstring">    'right'), etc.</tt> </tt>
<a name="L188"></a><tt class="py-lineno">188</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L189"></a><tt class="py-lineno">189</tt>  <tt class="py-line"><tt class="py-docstring">    @type  pos: sequence</tt> </tt>
<a name="L190"></a><tt class="py-lineno">190</tt>  <tt class="py-line"><tt class="py-docstring">    @param pos: New position of rectangle's point relative to which</tt> </tt>
<a name="L191"></a><tt class="py-lineno">191</tt>  <tt class="py-line"><tt class="py-docstring">    rectangle is aligned.</tt> </tt>
<a name="L192"></a><tt class="py-lineno">192</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L193"></a><tt class="py-lineno">193</tt>  <tt class="py-line"><tt class="py-docstring">    @type  align: str or sequence</tt> </tt>
<a name="L194"></a><tt class="py-lineno">194</tt>  <tt class="py-line"><tt class="py-docstring">    @param align: String naming C{pygame.Rect} property or sequence containing</tt> </tt>
<a name="L195"></a><tt class="py-lineno">195</tt>  <tt class="py-line"><tt class="py-docstring">    pair of such strings.</tt> </tt>
<a name="L196"></a><tt class="py-lineno">196</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L197"></a><tt class="py-lineno">197</tt>  <tt class="py-line"> </tt>
<a name="L198"></a><tt class="py-lineno">198</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">type</tt><tt class="py-op">(</tt><tt id="link-17" class="py-name"><a title="base.AGRect.align
base.Overlay.align" class="py-name" href="#" onclick="return doclink('link-17', 'align', 'link-15');">align</a></tt><tt class="py-op">)</tt> <tt class="py-keyword">is</tt> <tt class="py-name">tuple</tt> <tt class="py-keyword">or</tt> <tt class="py-name">type</tt><tt class="py-op">(</tt><tt id="link-18" class="py-name"><a title="base.AGRect.align
base.Overlay.align" class="py-name" href="#" onclick="return doclink('link-18', 'align', 'link-15');">align</a></tt><tt class="py-op">)</tt> <tt class="py-keyword">is</tt> <tt class="py-name">list</tt><tt class="py-op">:</tt> </tt>
<a name="L199"></a><tt class="py-lineno">199</tt>  <tt class="py-line">      <tt class="py-name">setattr</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt id="link-19" class="py-name"><a title="base.AGRect.align
base.Overlay.align" class="py-name" href="#" onclick="return doclink('link-19', 'align', 'link-15');">align</a></tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt class="py-name">pos</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L200"></a><tt class="py-lineno">200</tt>  <tt class="py-line">      <tt class="py-name">setattr</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt id="link-20" class="py-name"><a title="base.AGRect.align
base.Overlay.align" class="py-name" href="#" onclick="return doclink('link-20', 'align', 'link-15');">align</a></tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt class="py-name">pos</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L201"></a><tt class="py-lineno">201</tt>  <tt class="py-line">    <tt class="py-keyword">elif</tt> <tt class="py-name">type</tt><tt class="py-op">(</tt><tt id="link-21" class="py-name"><a title="base.AGRect.align
base.Overlay.align" class="py-name" href="#" onclick="return doclink('link-21', 'align', 'link-15');">align</a></tt><tt class="py-op">)</tt> <tt class="py-keyword">is</tt> <tt class="py-name">str</tt><tt class="py-op">:</tt> </tt>
<a name="L202"></a><tt class="py-lineno">202</tt>  <tt class="py-line">      <tt class="py-name">setattr</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt id="link-22" class="py-name"><a title="base.AGRect.align
base.Overlay.align" class="py-name" href="#" onclick="return doclink('link-22', 'align', 'link-15');">align</a></tt><tt class="py-op">,</tt> <tt class="py-name">pos</tt><tt class="py-op">)</tt> </tt>
<a name="L203"></a><tt class="py-lineno">203</tt>  <tt class="py-line">    <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L204"></a><tt class="py-lineno">204</tt>  <tt class="py-line">      <tt class="py-keyword">raise</tt> <tt class="py-name">ValueError</tt><tt class="py-op">(</tt><tt class="py-string">"Invalid align value"</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L205"></a><tt class="py-lineno">205</tt>  <tt class="py-line"> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0beta1 on Thu Jul 31 17:03:03 2008
    </td>
    <td align="right" class="footer">
      <a href="http://epydoc.sourceforge.net">http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie()
  // -->
</script>
  
</body>
</html>
